<html><head>
<script type="text/javascript">
        var djConfig = {isDebug: true};
</script>
<script type="text/javascript" src="../../dojo.js"></script>
<script type="text/javascript">
dojo.require("dojo.widget.LayoutContainer");
dojo.require("dojo.widget.ContentPane");

function setCssText(node, cssText){
	// make opera sing
	if(dojo.lang.isUndefined(node.style.cssText)){
		node.setAttribute("style", cssText);
	}else{
		node.style.cssText= cssText;
	}
}

function init() {
	var layout = dojo.widget.createWidget("LayoutContainer");
	document.body.appendChild(layout.domNode);
	setCssText(layout.domNode, "width: 500px; height: 500px; border: 3px solid blue; background: #eeeeee");

	var taulu=["top","bottom","client","right","left"];
	for(i=0; i<taulu.length; ++i) {
		var content = dojo.widget.createWidget("ContentPane", {layoutAlign: taulu[i]});
		setCssText(content.domNode, "width: 100px; height: 100px; border: 3px solid red;");
		content.setContent(taulu[i]);
		layout.addChild(content);
	}

	layout.onResized();
}
dojo.addOnLoad(init);
</script>
</head>
<body>
<h1>Test of layout code programmatic creation</h1>
</body>
</html>
